/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.workplicity.marist.print;

import java.awt.Font;
import java.awt.print.PrinterException;
import javax.swing.JEditorPane;
import javax.swing.SwingUtilities;
import org.workplicity.marist.grounds.util.Report;

/**
 *
 * @author Stephen Horn
 */
public class ReportPrint extends JEditorPane {

    public static JEditorPane reportPane = new JEditorPane();

    public void printReport() {
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                reportPane.setFont(new Font("Courier New", Font.PLAIN, 10));
                boolean hasPrinted = false;
                reportPane.setText(Report.output());
                try {
                    hasPrinted = reportPane.print();
                } catch (PrinterException e) {
                    e.printStackTrace();
                }
            }
        });
    }
}
